//import io.minio.*;
//import io.minio.errors.*;
//
//import java.io.File;
//import java.io.FileInputStream;
//import java.io.IOException;
//import java.io.InputStream;
//import java.security.InvalidKeyException;
//import java.security.NoSuchAlgorithmException;
//
//public class Test {
//    public static void main(String[] args) throws IOException, InvalidKeyException, InvalidResponseException, InsufficientDataException, NoSuchAlgorithmException, ServerException, InternalException, XmlParserException, ErrorResponseException {
//        MinioClient build = MinioClient.builder()
//                .endpoint("http://192.168.117.80:9000")
//                .credentials("1111111111", "1111111111")
//                .build();
//        File file = new File("E:/template/wang.jpg");
//        InputStream inputStream = new FileInputStream(file);
//        PutObjectArgs kewu = PutObjectArgs.builder()
//                .stream(inputStream, file.length(), -1)
//                .bucket("kewu")
//                .object("wang.jpg")
//                .build();
//        build.putObject(kewu);
//        // 没有桶创建桶
//        boolean found = build.bucketExists(BucketExistsArgs.builder().bucket("kewu").build());
//        if (!found) {
//            // Make a new bucket called 'asiatrip'.
//            build.makeBucket(MakeBucketArgs.builder().bucket("kewu").build());
//        } else {
//            System.out.println("桶不存在");
//        }
//        UploadObjectArgs objectArgs = UploadObjectArgs.builder()
//                .filename("E:/template/wang.jpg")
//                .bucket("kewu")
//                .object("wang.jpg")
//                .build();
//        build.uploadObject(objectArgs);
//        System.out.println("success");
//    }
//}
